<style>
.chat-main{-webkit-box-flex: 1;-moz-box-flex: 1;-webkit-flex: 1;-ms-flex: 1;flex: 1;width: 100%;font-size: 0.65rem;padding:0.5rem 0;overflow-x: hidden;-webkit-overflow-scrolling: touch;display: block;}
.chat-main .chatlog(padding: 0.2rem;width:100%)
.chatlog .r .pic{float: right;width: 2rem;height: 2rem;border-radius: 0.2rem; margin-left:0.65rem;margin-right: 1.3rem;background: url('{{tomedia(pagedata.pluginset.avatar) || '../core/resource/images/gw-wx.png'}}') no-repeat;background-size: 100% 100%;}
.chatlog .l .pic{float: left;width: 2rem;height: 2rem;border-radius: 0.2rem; margin-left:0.65rem;margin-right: 0.65rem;background: url('{{tomedia(pagedata.pluginset.avatar) || '../core/resource/images/noavatar.gif'}}') no-repeat;background-size: 100% 100%;}
.chatlog .text{text-align: left;line-height: 1rem; padding: 0.4rem;font-size:0.7rem;background: #F5F5F7;border-radius: 0.2rem;color: #333;width: auto;max-width:13.25rem;  }
.chatlog .r .text{float: right;background: #00a3f0;color: #fff;margin-left: 0; }
.chatlog .l .text{float: left;background: #fff;margin-left:0}

.page_rain{
	position: absolute;top:0;bottom:0;width:100%;z-index:108;background: rgba(0, 0, 0, 0.3);display:none
}
.startred{
	width: 100%;
	min-height:100%;
	position: relative;
	overflow: hidden;
}
.startred > div{
	width: 80px;
	height: 90px;
	position: absolute;
	top: 0;
	right: 0;
	background-image: url(../addons/jy_weidish_xibei/resource/images/icon_package.png);
	background-repeat: no-repeat;
	background-size: 155px 215px;
	background-position: 0px -1px;
	
}
</style>
<div class='fui-page fui-page-current' style="background:red">
	<div class="page_rain" ng-if="!pagedata.page_rainnone">
		<div class="dd" ng-click="pagedata.getred()" style="left: 4px; top: 623px;"></div>
		<div class="startred"></div>
	</div>
    <div class="fui-content" style="position: relative;margin-bottom:2.2rem;background:red">
	</div>
</div>
<div ng-if="pagedata.showgetred" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="width:80%;padding: 1rem;background:#fff">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showgetred=false"></i>
			<div class="fui-content" style="background:none;padding-bottom:0">
				<!--状态-->
				<div class="order_header">
					  <div class="red" style="width:3.6rem;margin:0 auto">
						<img style="width:3.6rem;height:3.6rem" ng-src="{{tomedia(pagedata.pluginset.getmoneytop) || '../addons/jy_red_rain/images/getmoneytop.png'}}">
					  </div>
					  <div class="order_detail_ststus c" style="padding:0.3rem;background:none">
							<div style="font-size: 0.85rem;">{{pagedata.info}}</div>
							<div class="c gray">可以前往个人中心查看~~</div>
					  </div>
					</div>
					<div class="weui_btn_area" style="margin:2rem;margin-bottom:0.5rem">				
						<a ng-click="pagedata.showgetred=false" class="weui_btn weui_btn_red" style="border-radius:1rem" href="javascript:">领取奖励</a>
					</div>
			</div>
		</div>
	</div>
</div>
<script>
function raintime(){
		for(var i=0;i<4;i++){	
			var m=parseInt(Math.random()*700+100);
			var j2=parseInt(Math.random()*300+1200);
			var j=parseInt(Math.random()*($(window).width()+400)+000);
			var j1=parseInt(Math.random()*300+300);
			var n=parseInt(Math.random()*10+(-10));
			$('.startred').prepend('<div class="dd"></div>');
			$('.startred').children('div').eq(0).css({'left':j,'top':n});
			$('.startred').children('div').eq(0).animate({'left':j-j1,'top':$(window).height()+20},2800);
		}
};
scope.pagedata.startred=function(){
	scope.pagedata.times=0
	var Timerr = setInterval(raintime,800);
	$(".page_rain").css("display","block");
	var removepackage = setInterval(function(){
			if(scope.pagedata.times>=60){
				clearInterval(Timerr);
				clearInterval(removepackage);
				scope.pagedata.page_rainnone=true;
				$(".page_rain").css("display","none");
			}
			scope.pagedata.times++;
			for(var jj=0;jj<$('.startred>div').size()/4;jj++){
					$('.startred>div').eq($('.startred>div').size()-jj).remove();
			}
	},1000);
}
$(document).on('touchstart', '.dd', function(){
	var random = Math.floor((Math.random()*10)+1);
	if(random>5){		
		scope.post_json('jy_red_rain/index/getreward/',{'id':scope.pagedata.game.id},function(res){
			scope.pagedata.info=res.info
			scope.pagedata.showgetred=true;
			scope.pagedata.page_rainnone=true;
			$(".page_rain").css("display","none");
			window.scope.$evalAsync();
		});
	}else{
		$('.dd').css("background-position","0 -100px");	
	}
});
scope.pagedata.time_down=function(){
				if(typeof(scope.pagedata.redlasttime)!='object'){
					return false;
				}
				setTimeout(function(){
					var is_continue=false;
					if(scope.pagedata.redlasttime.second>0){
						scope.pagedata.redlasttime.second--;
						is_continue=true;
					}else{
						if(scope.tool.minute_down(scope.pagedata.redlasttime)){
							scope.pagedata.redlasttime.second=59;
							is_continue=true;
						}
					}
					if(is_continue){
						window.scope.$evalAsync();
						scope.pagedata.time_down(scope.pagedata.redlasttime);
					}else{
						scope.pagedata.startred();
					}
				},1000);
}
scope.pagedata.startred();
</script>